home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC Gamer (Italian) 35
/
PC Gamer IT CD 35 1-2.iso
/
Elink
/
NSCOMM
/
NCJS10.JAR
/
dialog.js
< prev
next >
Wrap
Text File
|
1997-10-20
|
2KB
|
122 lines
/*
* dialog.js
*
* Copyright (c) 1997 Netscape Communications Corporation, All Rights Reserved
*
* Utility functions for dealing with dialog boxes in Netcaster
*/
var gTabShowing = "";
function showTab(tabName)
{
var tabLayerName;
if (gTabShowing == tabName) {
return;
}
if (gTabShowing != "") {
var tabLayerName = gTabShowing + "Tab";
if (document.layers[gTabShowing].document.hiding) {
if (!document.layers[gTabShowing].document.hiding())
return;
}
document.layers[gTabShowing].visibility="hide";
if ( document.layers[gTabShowing].hideChildren )
document.layers[gTabShowing].hideChildren();
document.layers[tabLayerName].clip.height -= 3;
document.layers[tabLayerName].y += 2;
document.layers[tabLayerName].clip.width -= 2;
}
document.layers[tabName].visibility="show";
if ( document.layers[tabName].showChildren )
document.layers[tabName].showChildren();
tabLayerName = tabName + "Tab";
document.layers[tabLayerName].y -= 2;
document.layers[tabLayerName].clip.height += 3;
if (gTabShowing != "") {
document.layers[tabLayerName].clip.width += 2;
}
gTabShowing = tabName;
if (document.layers[gTabShowing].document.showing) {
document.layers[gTabShowing].document.showing();
}
return;
}
function handleHelp(topic)
{
if ((topic == null) || (topic == ""))
topic = "net_main_about";
self.location.href = "nethelp:netscape/netcastr:" + topic;
}
// handleCancel simply dismisses the dialog, optionally calling
// a callback function.
function handleCancel()
{
if (self.closing && self.closing != null) {
self.closing();
}
self.close();
}
function trimString(jsString)
{
var tempStr = new java.lang.String(jsString);
tempStr.trim();
return tempStr.toString();
}
function fieldEmpty(field)
{
if ((field == null) || (field.value == null) || (field.value == ""))
return true;
var tempStr = trimString(field.value);
if (tempStr == "")
return true;
return false;
}
function getKey(e)
{
alert("The key: " + e.which);
}
function getDrag(e)
{
var fileNames = e.data;
alert("File: " + e.data[0]);
for (var i=0; i< fileNames.length; i++) {
alert("Dragged: fileNames[0]");
}
return false;
}
void(0);